﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace pHM.DVBLib.Common
{
    public class LogItem
    {
        public Exception innerException { get; set; }
        public String Text { get; set; }
        public String Sender { get; set; }
        public LogLevels LogLevel { get; set; }

        public override string ToString()
        {
            if (innerException == null)
            {
                return string.Format("{0} - {1}", Sender, Text);
            }
            else
            {
                return string.Format("{0} - {1}, Exception: {2}", Sender, Text, innerException);
            }
        }
    }

    [Flags]
    public enum LogLevels
    {
        None = 0x0,
        Error = 0x1,
        Warning = 0x02,
        Information = 0x04,
        Debug = 0x08,
        All = 0xFF
    }
}
